<%@ page pageEncoding="UTF-8"%>
<%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+
		(request.getServerPort() == 80 ? "" : (":"+request.getServerPort())) +path+"/";  
%>

<script type="text/javascript">
	var base_path = "<%=basePath%>";
</script>
<base href="<%=basePath%>">
<link rel='stylesheet' href='resources/css/base.css'/>
    <link rel='stylesheet' href='resources/css/admin/layout.css'/>
	<link rel='stylesheet' href='resources/css/admin/colors.css'/>
	<link rel='stylesheet' href='resources/css/global.css'/>
   	<link rel="stylesheet" href="resources/css/global.css" type="text/css" media="screen" />
	<link rel="stylesheet" href="resources/css/home/layout.css" type="text/css" media="screen" />
	<!--[if lte IE 7]>
	<link rel='stylesheet' href='resources/css/admin/ie.css'/>
	<![endif]-->
	<script type="text/javascript" src='resources/js/jquery.form.js'></script>
    <script type="text/javascript" src='resources/js/jquery-1.5.2.min.js'></script>
	<script type="text/javascript" src='resources/js/util.eduapp.js'></script>
	<script type="text/javascript" src='resources/js/eduapp.slice.js'></script>
    <script type="text/javascript" src='resources/js/popup.js'></script>
<script language="javascript">
/*$(function(){

	$(".sub").click(function(){
		alert("asd");
		alert($(".accountNo").val());
		if($(".accountNo").val()==""){
			alert("空")；
		}else{
			alert("非空")；
		}	
	});
});*/
$(function(){
	$("#form").submit(function(){
		var pa=parent;
			var options = {
				//target:'#tip', //后台将把传递过来的值赋给该元素
				//url:'admin/account/save', //提交给哪个执行
				type:'POST',
				success: function(){
					alert("aaa");
					parent.$("#search").click();
					//$("#tip").text("修改成功");
					//if ($("#id").val() == "") {
					parent.ClosePop();
					//} else {
					//	parent.ClosePop();
					//}
				} //显示操作提示
			};
			alert(parent);
		/*var no=$("#accountNo").value();
		alert(no);
		var name=$("#accountRealName").value();
		var maj=$("#accountMajority").value();
		var grade=$("#accountGrade").value();
		var pass=$("#accountPassword").value();
		var id=$("#accountIdentification").value();
		var phone=$("#accountMobilePhone").value();
		if(no!=""&&name!=""&&maj!=""&&grade!=""&&pass!=""&&id!=""&&phone!=""){*/
		var no=document.form.accountNo.value;
	var name=document.form.accountRealName.value;
	var role=document.form.account_role.value;
	var maj=document.form.accountMajority.value;
	var grade=document.form.accountGrade.value;
	var pass=document.form.accountPassword.value;
	var id=document.form.accountIdentification.value;
	var phone=document.form.accountMobilePhone.value;
	if(no!=""&&name!=""&&maj!=""&&grade!=""&&pass!=""&&id!=""&&phone!=""){
			$('#form').ajaxSubmit(options);
			}else{
				alert("数据输入不完整");
			}
			return false; //为了不刷新页面,返回false，反正都已经在后台执行完了，没事！
		});
});




function check(){
 	alert("11");
	var no=document.form.accountNo.value;
	var name=document.form.accountRealName.value;
	var role=document.form.account_role.value;
	var maj=document.form.accountMajority.value;
	var grade=document.form.accountGrade.value;
	var pass=document.form.accountPassword.value;
	var id=document.form.accountIdentification.value;
	var phone=document.form.accountMobilePhone.value;
	if(no!=""&&name!=""&&maj!=""&&grade!=""&&pass!=""&&id!=""&&phone!=""){
		alert("11");
		var pa=this.parent;
		$("#form").submit();
		//return true;	
		pa.ClosePop();
	}else{
		alert("未填写完成");
		alert("no");
		return false;
		
	}
	
 }


</script>

<body>
<form action="admin/account/save" method="post" action="post" id="form" name="form">
<div class="p">
       <table width="90%" cellpadding="0" cellspacing="0" border="1" style="text-align:center;" class="datagrid" align="center">
                                <thead>
                                <tr>
                                	<td>
                                    	添加用户                                    </td>
                                    <td>                                    </td>
                                </tr>
                                </thead>
                                    <tr>
                                        <td><span>用户
                                          <input type="text" size="12" id="accountNo" name="accountNo" class="text accountNo" value="${search_vo.trainStationName}" id="t_stationname2" />
                                        名: </span></td>
                                      <td><span>姓名: <input type="text" size="12" id="accountRealName" name="accountRealName" class="text" value="${search_vo.trainStationName}" id="t_stationname" /></span></td>
                                    </tr>
                                    <tr>
                                    	<td><span>类型：  <select name="account_role" size=1 >
                                        <option value="1">学生</option>
                                        <option value="2">教师</option>
                                        <option value="3">学校管理员</option>
                                        <option value="4">学院管理员</option>
                                        <option value="5">年级管理员</option>
                                        <option value="6">系统管理员</option>
                                        </select>
</span></td>
                                        <td> <span>专业: <input type="text" size="12" id="accountMajority" name="accountMajority" class="text" value="${search_vo.trainStationName}" id="t_stationname" /></span></td>
                                    </tr>
                                    <tr>
                                        <td><span>年级: <input type="text" size="12" id="accountGrade" name="accountGrade" class="text" value="${search_vo.trainStationName}" id="t_stationname" /></span></td>
                                        <td><span>班级: <input type="text" size="12" id="accountClass" name="accountClass" class="text" value="${search_vo.trainStationName}" id="t_stationname" /></span></td>
                                    </tr>
                                    <tr>
                                    	<td><span>密码: <input type="text" size="12" id="accountPassword" name="accountPassword" class="text" value="${search_vo.trainStationName}" id="t_stationname" /></span></td>
                                        <td><span>身份证: <input type="text" size="12" id="accountIdentification" name="accountIdentification" class="text" value="${search_vo.trainStationName}" id="t_stationname" /></span></td>
                                    </tr>
                                    <tr>
                                    	<td><span>手机: <input type="text" size="12" id="accountMobilePhone" name="accountMobilePhone" class="text" value="${search_vo.trainStationName}" id="t_stationname" /></span></td>
                                        <td><input type="submit" value="添加新用户" class="sbtn sub" id="sub" /></td>
                                    </tr>
                                	  
                                <tbody>
                                </tbody>
                            </table>        
</div>   
</form>
</body>